﻿using DocumentFormat.OpenXml.Lite.DrawingML.Geometry.Properties;
using DocumentFormat.OpenXml.Lite.DrawingML.Text;
using DocumentFormat.OpenXml.Lite.DrawingML.Text.Properties;
using DocumentFormat.OpenXml.Lite.DrawingML.Types;
using DocumentFormat.OpenXml.Lite.Shared;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.DrawingML.Chart
{
    [XmlRoot("legend", Namespace = Constants.Chart)]
    public class Legend : XmlSerializable
    {
        [Optional]
        [XmlElement("legendPos", Namespace = Constants.Chart)]
        public NullableValue<ST_LegendPos> LegendPosition { get; set; }

        [Optional]
        [XmlElement("legendEntry", Namespace = Constants.Chart)]
        public XmlList<LegendEntry> LegendEntries { get; set; }

        [Optional]
        [XmlElement("layout", Namespace = Constants.Chart)]
        public Layout Layout { get; set; }

        [Optional]
        [XmlElement("overlay", Namespace = Constants.Chart)]
        public NullableValue<bool> Overlay { get; set; }

        [Optional]
        [XmlElement("spPr", Namespace = Constants.Chart)]
        public ShapeProperties ShapeProperties { get; set; }

        [Optional]
        [XmlElement("txPr", Namespace = Constants.Chart)]
        public TextProperties TextProperties { get; set; }

        [Optional]
        [XmlElement("extLst", Namespace = Constants.Chart)]
        public ExtensionList ExtensionList { get; set; }

        public Legend() 
        {
            LegendEntries = new XmlList<LegendEntry>();
        }
    }
}
